package com.yango.product.controller;

import com.yango.product.pojo.Product;
import com.yango.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {
    @Autowired
    private ProductService productService;
    @GetMapping("/product/{id}")
    public Product getProductById(@PathVariable("id") Long id) {
        Product product = productService.getProductById(id);
        return product;
    }
}
